#!/bin/bash
NDK=D:/Work/android-ndk-r15c-windows-x86_64/android-ndk-r15c
NDKABI=21
NDKVER=$NDK/toolchains/x86_64-4.9/prebuilt/windows-x86_64
NDKP=$NDKVER/bin/x86_64-linux-android-
NDKF="--sysroot $NDK/platforms/android-$NDKABI/arch-x86_64"

cd luajit-2.1/src
make clean
make HOST_CC="gcc -O2 -m64" CROSS=$NDKP TARGET_SYS=Linux TARGET_FLAGS="$NDKF"
cp ./libluajit.a ../../android/jni/libluajit.a
make clean

cd ../../android
D:/Work/android-ndk-r15c-windows-x86_64/android-ndk-r15c/ndk-build.cmd clean APP_ABI="x86_64"
D:/Work/android-ndk-r15c-windows-x86_64/android-ndk-r15c/ndk-build.cmd APP_ABI="x86_64"
cp libs/x86_64/libtolua.so ../Plugins/Android/libs/x86_64